

Rsd.define('Rsd.Faith.pages.BookFenHuListPage', {
    extend: 'Rsd.Faith.pages.ListPage',
    requires: ['Rsd.Faith.controls.XiaoQuInput',  'Rsd.controlEx.ComboBoxEnum'],
    xtype: 'list-fenghu',
    border: false,
    tabTitle: '分户账户',
    searchColumns:[{name:'ZhangHuBianHao',"text": "账户编号",width:250},{name:'YeZhuXingMing',text:'业主姓名',width:250},{name:'FangWuBianHao',text:'房屋编号',width:250},{name:'XiaoQuBianHao',text:'小区编号',width:250}],
    newButtons:[{text:'补录入分户信息',handler:'openItem'}],
    modelType: 'BookFenHuZhangModel',
    readOnly:false,
    formFields: [],
    gridColumns: [
        {
            "text": "序号",
            "xtype": "index",
            "width": 40,
            "index": 0
        },
        {
            "name": "ZhangHuBianHao",
            "dataIndex": "ZhangHuBianHao",
            "sortable": false,
            "text": "账户编号",
            "index": 20,
            "exist": true,
            "xtype": "string",
            format:'format_ZhangHuBianHao',
            "width": 150,
            "nobr": true
        },
        {
            "name": "SuoShuQi",
            "dataIndex": "SuoShuQi",
            "sortable": false,
            "text": "当前所属期",
            "index": 29,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "JianZhangRiQi",
            "dataIndex": "JianZhangRiQi",
            "sortable": false,
            "text": "建账日期",
            "index": 22,
            "exist": true,
            "xtype": "date",
            "formatString": "yyyy-MM-dd",
            "width": 100,
            "precision": 3
        },
        {
            "name": "XiaoQuBianHao",
            "dataIndex": "XiaoQuBianHao",
            "sortable": false,
            "text": "小区",
            "index": 24,
            "exist": true,
            "xtype": 'ctrl-xiaoqu',
            "width": 150,
            "nobr": true
        },
        {
            "name": "FangWuBianHao",
            "dataIndex": "FangWuBianHao",
            "sortable": false,
            "text": "房屋编号",
            "index": 25,
            "exist": true,
            "xtype": "string",
            "width": 150,
            "nobr": true
        },
        {
            "name": "JiaoCunJinE",
            "dataIndex": "JiaoCunJinE",
            "sortable": false,
            "text": "缴存金额",
            "index": 26,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },

        {
            "name": "ShiYongJinE",
            "dataIndex": "ShiYongJinE",
            "sortable": false,
            "text": "已使用金额",
            "index": 28,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "YuE",
            "dataIndex": "YuE",
            "sortable": false,
            "text": "余额",
            "index": 31,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "ShouYiJinE",
            "dataIndex": "ShouYiJinE",
            "sortable": false,
            "text": "利息",
            "index": 27,
            "exist": true,
            "xtype": "number",
            "width": 100,
            "precision": 2
        },
        {
            "name": "ZhuangTai",
            "dataIndex": "ZhuangTai",
            "sortable": false,
            "text": "状态",
            "index": 32,
            "exist": true,
            "xtype": "enum",
            "enum": {
                "name": "Rsd.Faith.Core.ZhuangHuZhuangTai",
                "items": [
                    {
                        "code": "DG",
                        "text": "中心代管",
                        "value": 0
                    },
                    {
                        "code": "ZG",
                        "text": "小区自管",
                        "value": 1
                    },
                    {
                        "code": "TH",
                        "text": "已退伙",
                        "value": 2
                    }
                ]
            },
            "width": 100,
            "nobr": true
        },
        {
            "name": "Remark",
            "dataIndex": "Remark",
            "sortable": false,
            "text": "备注",
            "index": 200,
            "exist": true,
            "xtype": "string",
            "width": 50,
            "nobr": true
        }
    ],
    titleField : 'FaPiaoBianHao',
    /*
     * */
    constructor: function (config) {
        config = config || {};
        Rsd.apply(this, config);
    },
    format_ZhangHuBianHao:function format_ZhangHuBianHao( row) {
        var btn = document.createElement('a');
        btn.href='#';
        btn.innerHTML = '详情';
        $(btn).click (function(){
            Rsd.create('Rsd.Faith.dialogs.InfoFenHuZhangDialog',{data:row}).showDialog();
        } );
        return [Rsd.newLine(),btn]
    }


});